#ifndef TB6612_DRIVER_H
#define TB6612_DRIVER_H
#include "PORT_Manage.h"
typedef struct TB6612DeviceTypeDef
{
    PORT_TypeDef A1;
    PORT_TypeDef A2;
    PORT_TypeDef B1;
    PORT_TypeDef B2;
    unsigned short PWM_ChannelA;
    unsigned short PWM_ChannelB;
}TB6612DeviceTypeDef;

typedef enum {ChannelA, ChannelB}TB6612Channel_TypeDef;

void TB6612_RegisterPWMController(void (*handler)(unsigned short, unsigned short));
void TB6612_Stop(TB6612DeviceTypeDef *device , TB6612Channel_TypeDef Channelx);
void TB6612_Free(TB6612DeviceTypeDef *device , TB6612Channel_TypeDef Channelx);
void TB6612_GoForward(TB6612DeviceTypeDef *device , TB6612Channel_TypeDef Channelx);
void TB6612_GoBack(TB6612DeviceTypeDef *device , TB6612Channel_TypeDef Channelx);
void TB6612_SetSpeed(TB6612DeviceTypeDef *device , TB6612Channel_TypeDef Channelx, unsigned short speed);
#endif
